package cn.shyouchi.wuguanjia.android.api;

import android.content.Context;

import cn.shyouchi.wuguanjia.android.components.storage.UserStorage;

/**
 * Created by Eenie on 2017/3/3 at 14:37
 * Email: 472279981@qq.com
 * Des:
 */

public class UserStorageProvider {
    private static UserStorageProvider mDefault;
    private static UserStorage mUserStorage;

    private static Context sContext;


    public static void register(Context context) {
        sContext = context;
    }

    public static UserStorage Default() {
        if (mDefault == null) {
            synchronized (UserStorageProvider.class) {
                if (mDefault == null) {
                    mDefault = new UserStorageProvider();
                    mUserStorage = new UserStorage(sContext);
                }
            }
        }
        return mUserStorage;
    }

}
